package com.qzl.feiq.strategy.impl;

import com.qzl.feiq.annotation.ReceiveType;
import com.qzl.feiq.enu.MessageTypeEnum;
import com.qzl.feiq.message.Message;
import com.qzl.feiq.strategy.Receive;
import io.netty.channel.Channel;
import lombok.extern.slf4j.Slf4j;
import com.qzl.feiq.config.StaticConfig;

@Slf4j
@ReceiveType(command = StaticConfig.IPMSG_BR_ABSENCE)
public class IpmsgBrAbsenceImpl implements Receive {
    @Override
    public void receiveMsg(Channel channel, Message oldMessage) {
        log.info("处理输入回复数据，消息已接通");
        Message message = new Message(oldMessage.getFromUserIp(), MessageTypeEnum.broadcast, StaticConfig.IPMSG_ANSENTRY);
        channel.writeAndFlush(message);
        int command = StaticConfig.IPMSG_ABSENCEOPT | StaticConfig.IPMSG_BR_ENTRY;
        Message message1 = new Message(oldMessage.getFromUserIp(), MessageTypeEnum.broadcast, command);
        channel.writeAndFlush(message1);

    }
}
